﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
namespace WPFExcelReport
{
    public partial class UIBAAUF : ViewBase
    { 
      
        public UIBAAUF()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
        }

        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            base.Window_Loaded(sender, e);

        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);

            if (dwMaster == null)
            {
                KEY = "";
                WARP = "";
            }
            else
            {
                KEY=TMV.BAAUFKRS + TMV.BAAUFLFD+TMV.BAAUFPOS+TMV.BAPOS;
                WARP ="B"+ TMV.BAKART + TMV.BAKVAR + TMV.BAKFARBE + KEY;
            }
        }
        
    }
    public partial class UIBAAUF 
    {

        public VBAAUF TMV
        {
            get
            {
                return (VBAAUF)MV;
            }
        }
        #region ==WARP===========
        public static readonly DependencyProperty WARPProperty = DependencyProperty.Register("WARP",
            typeof(string), typeof(UIBAAUF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnWARPChanged));
        public string WARP
        {
            get
            {
                return (string)GetValue(WARPProperty);
            }
            set
            {
                SetValue(WARPProperty, value);
                OnWARPChg();
            }
        }
        private static void OnWARPChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIBAAUF;
            if (src != null)
            {
                src.WARP = (string)e.NewValue;
            }
        }
        public virtual void OnWARPChg()
        { }
        #endregion
    }
 }
